package com.t13;

import net.mindview.util.Pair;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by xuyiwei on 2018/7/31.
 */
public class Finding {
    public static void main(String[] args) {
        Matcher matcher = Pattern.compile("\\w+").matcher("Evening is full of the linnet is wings");
        while (matcher.find()){
            System.out.print(matcher.group()+" ");
        }
        System.out.println();
        int i = 0;
        //i表示已这个索引作为搜索的起点
        while (matcher.find(i)){
            System.out.print(matcher.group()+" ");
            i++;
        }
        //Evening is full of the linnet is wings
        //Evening vening ening ning ing ng g is is s full full ull ll l of of f the the he e linnet linnet innet nnet net et t is is s wings wings ings ngs gs s
    }
}
